package com.wjyf.reducing_bento.model.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 商品表
 * </p>
 *
 * @author wjyf
 * @since 2023-03-14 08:36:32
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("tb_commodity")
@ApiModel(value = "CommodityBean对象", description = "商品表")
public class CommodityBean extends Model<CommodityBean> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("商品id")
    @TableId(value = "cod_id", type = IdType.AUTO)
    private Integer codId;

    @ApiModelProperty("商品名字")
    @TableField("cod_name")
    private String codName;

    @ApiModelProperty("商品价格")
    @TableField("cod_price")
    private Double codPrice;

    @ApiModelProperty("商品库存")
    @TableField("cod_stock")
    private Integer codStock;

    @ApiModelProperty("商品注释")
    @TableField("cod_details")
    private String codDetails;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty("修改时间")
    @TableField(value = "modify_time", fill = FieldFill.INSERT_UPDATE)
    private Date modifyTime;


    @Override
    public Serializable pkVal() {
        return this.codId;
    }

}
